import { Pipe, PipeTransform } from '@angular/core';

/**
 * Generated class for the HtmlEncodePipe pipe.
 *
 * See https://angular.io/api/core/Pipe for more info on Angular Pipes.
 */
@Pipe({
  name: 'htmlEncode',
})
export class HtmlEncodePipe implements PipeTransform {
  /**
   * Takes a value and makes it lowercase.
   */
  transform(value: string, ...args) {
    return this.htmlEncode(value);
  }

  htmlEncode(htmlContent) {
    var text = htmlContent.replace(/<\/?.+?>/g,"").replace(/ /g,"").replace(/&nbsp;/ig, "");
    return text;
  }

}
